<template>
<div>
    <common-header
        :title="title"
        :type=3></common-header>
    <div class="mui-content sDemand-details">
        <div class="sDemand-details-title">
            <ul>
                <li>
                    <p class="mui-icon iconfont icon-tubiao- sDemand-details-icon sDemand-details-Txun"></p>
                    <p class="sDemand-details-num">年份:</p>
                    <p class="sDemand-details-an">{{ data.Year }}</p>
                </li>
                <li class="sDemand-details-li-state">
                    <p class="sDemand-details-state">{{ data.statusText }}</p>
                </li>
            </ul>
        </div>
        <div class="sDemand-details-cont">
            <ul>
                <li>
                    <p class="sDemand-details-num">波段号:</p>
                    <p class="sDemand-details-an">{{ data.bandname }}</p>
                </li>
                <li>
                    <p class="sDemand-details-num">风格:</p>
                    <p class="sDemand-details-an">{{ data.fgText }}</p>
                </li>
                <li>
                    <p class="sDemand-details-num">大类:</p>
                    <p class="sDemand-details-an">{{ data.dlText }}</p>
                </li>
                <li>
                    <p class="sDemand-details-num">品类:</p>
                    <p class="sDemand-details-an">{{ data.xlText }}</p>
                </li>
                <li>
                    <p class="sDemand-details-num">上货款数:</p>
                    <p class="sDemand-details-an">4</p>
                </li>
                <li>
                    <p class="sDemand-details-num">提供样版款数:</p>
                    <p class="sDemand-details-an">4</p>
                </li>
                <li>
                    <p class="sDemand-details-num">审核时间:</p>
                    <p class="sDemand-details-an">{{ data.checkdate }}</p>
                </li>
                <li>
                    <p class="sDemand-details-num">上市时间:</p>
                    <p class="sDemand-details-an">2017-06-07</p>
                </li>
                <li>
                    <p class="sDemand-details-num">传图截止时间:</p>
                    <p class="sDemand-details-an">{{ data.uploaddate }}</p>
                </li>
            </ul>
        </div>
        <!-- <div class="sDemand-details-note">
            <ul>
                <li>
                    <p class="sDemand-details-num">备注:</p>
                    <p class="sDemand-details-an sDemand-details-pNotes">我是备注哦，你说我厉不厉害啊，哈哈哈哈哈！！！</p>
                </li>
            </ul>
        </div> -->
        <div class="sDemand-details-sure">
            <button id="sDemand-details-sure" type="button" class="mui-btn mui-btn-blue" @click="upload">上传样衣照片</button>
        </div>
    </div>
</div>
</template>

<script>
import { mapState ,mapMutations } from 'vuex'
import API from '@/service/api'
import commonHeader from '@/components/commonHeader.vue'
export default {
    components: { commonHeader },
    data() {
        return {
            title: '样衣波段需求详情',
            data: {}
        }
    },
    computed:{
        ...mapState( [ 'band_no' ] )
    },
    methods: {
        ...mapMutations( [ 'UPDATE_SHOW_LOADING' ] ),
        initialization() {
            API.band.getBandDetail({ id: this.band_no }).then(res=> {
                this.data = res
                this.UPDATE_SHOW_LOADING(false)
    		})
        },
        upload() {
            let uploaddate = `${this.data.uploaddate}`
            if(new Date(uploaddate).getTime()>new Date().getTime()) {
                this.$router.push( { name: 'bandUpload' } )
            }else {
                this.$error('传图日期已截止！')
            }
        }
    },
    created() {
       this.initialization()
    } 
}
</script>
